﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Autofac;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;

namespace JwtSwaggerWebApi.Middlewares
{
    public static class RequestCultureMiddlewareExtensions
    {
        public static IApplicationBuilder UseAutoInject(this IApplicationBuilder builder)
        {
            return builder.UseMiddleware<AutoInjectMiddleware>();
        }
    }
    public class AutoInjectMiddleware
    {
        private readonly RequestDelegate _next;

        public AutoInjectMiddleware(RequestDelegate next)
        {
            _next = next;
        }

        public Task Invoke(HttpContext context)
        {
            return this._next(context);
        }
    }
}